﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DLL.User
{
	/// <summary>
	/// 用户数据类
	/// </summary>
	/// <![CDATA[2014-7-30 09:06:58]]>
	public class Database : DataBaseBase
	{
		#region 属性
		/// <summary>
		/// 用户名
		/// </summary>
		/// <![CDATA[2014-7-30 09:09:08]]>
		public int USERNAME = 2;
		/// <summary>
		/// 密码
		/// </summary>
		/// <![CDATA[2014-7-30 09:09:20]]>
		public int PASSWORD = 3;
		/// <summary>
		/// 用户所属用户组ID
		/// </summary>
		/// <![CDATA[2014-7-30 10:22:59]]>
		public int USERGROUPID = 4;
		/// <summary>
		/// 用户所属单位ID
		/// </summary>
		/// <![CDATA[2014-8-15 11:03:56]]>
		public int DEPARTMENTID = 5;
		public int PERSONID = 6;
		public int JOBNUMBER = 7;
		public int PERSONNAME = 8;
		public int IDCARD = 9;
		public int REGISTER = 10;

		/// <summary>
		/// 用户组数据类对象
		/// </summary>
		/// <![CDATA[2014-8-3 14:58:50]]>
		public UserGroup.Database clsUserGroupDB;
		/// <summary>
		/// 单位数据类
		/// </summary>
		/// <![CDATA[2014-8-15 11:31:00]]>
		public Department.Database clsDepartmentDB;

		#endregion 属性

		/// <summary>
		/// 用户数据类构造函数
		/// </summary>
		/// <![CDATA[2014-7-30 09:07:50]]>
		/// <param name="page"></param>
		public Database(System.Web.UI.Page page)
			: base("[Users]", page)
		{
			clsUserGroupDB = new UserGroup.Database(page);
			clsDepartmentDB = new Department.Database(page);

			_strSQL = "SELECT * FROM (SELECT * FROM "+strTableName+" LEFT JOIN "+clsUserGroupDB.strTableName+" ON "+listStructure[USERGROUPID].strName+" = "+clsUserGroupDB.listStructure[clsUserGroupDB.ID].strName+") A LEFT JOIN "+clsDepartmentDB.strTableName+" ON "+listStructure[DEPARTMENTID].strName+" = "+clsDepartmentDB.listStructure[clsDepartmentDB.ID].strName+"";
		}

	}
}
